$("button").click(function(){""!=$("textarea").val()&&$.post("php/addComment.php",{vipName:localStorage.getItem("username"),goodsId:getParams("id"),content:$("textarea").val()},function(e){$.get("php/getComment.php",{goodsId:getParams("id"),pageCount:10,pageIndex:1},function(e){var e=JSON.parse(e),t=JSON.parse(e.data);let a="";for(let e=0;e<t.length;e++)a+=`<li>
                    <p>
                        <span>${t[e].vipName}</span>
                        <i>${t[e].commentTime}</i>
                    </p>
                    <p>${t[e].content}</p>
                </li>`;$(".liuyan ul").html(a)}),$("textarea").val("")})}),$.get("php/getComment.php",{goodsId:getParams("id"),pageCount:10,pageIndex:1},function(e){var e=JSON.parse(e),t=JSON.parse(e.data);let a="";for(let e=0;e<t.length;e++)a+=`<li>
        <p>
            <span>${t[e].vipName}</span>
            <i>${t[e].commentTime}</i>
        </p>
        <p>${t[e].content}</p>
    </li>`;$(".liuyan ul").html(a)});